@extends('wap.layout')
@section('content')
	<!--搜索框-->
	<div class="weui-search-bar" id="searchBar">
	  <form class="weui-search-bar__form"  action="/user_file/search">
	    <div class="weui-search-bar__box">
	      <i class="weui-icon-search"></i>
	      <input type="search" class="weui-search-bar__input" name="search_name" id="searchInput" placeholder="搜索" required="">
		  <input type="hidden" name="folder_id" id="folder_id" />
		  <input type="hidden" name="public_folder_id" id="public_folder_id" />
	      <a href="javascript:" class="weui-icon-clear" id="searchClear"></a>
	    </div>
	    <label class="weui-search-bar__label" id="searchText">
	      <i class="weui-icon-search"></i>
	      <span>搜索</span>
	    </label>
	  </form>
	  <a href="javascript:" class="weui-search-bar__cancel-btn" id="searchCancel">取消</a>
	</div>
	<!--搜索框end-->
	<!--文件列表-->
	<div class="fileList">
		<div class="weui-panel weui-panel_access">
		    <!-- body 部分 -->
		    <ul class="weui-panel__bd">
				<!-- 一个列表条目 -->
				<li  class="listItem">
					<a href="/list" class="weui-media-box weui-media-box_appmsg" id="public">
						<div class="weui-media-box__hd">
							<i class="fileIcon floder"></i>
						</div>
						<div class="weui-media-box__bd">
							<h4 class="weui-media-box__title">公共网盘</h4>
							{{--<p class="weui-media-box__desc">2017-11-1 09:47:30 565.9M</p>--}}
						</div>
					</a>
				</li>
				<!-- 一个列表条目 -->
		        <!-- 一个列表条目 -->
		        <li  class="listItem">
		        	<a href="/list" class="weui-media-box weui-media-box_appmsg" id="root">
			            <div class="weui-media-box__hd">
			                <i class="fileIcon floder"></i>
			            </div>
			            <div class="weui-media-box__bd">
			                <h4 class="weui-media-box__title">默认网盘</h4>
			                {{--<p class="weui-media-box__desc">2017-11-1 09:47:30 565.9M</p>--}}
			            </div>
			        </a>
		        </li>
		        <!-- 一个列表条目 -->
		        <li  class="listItem">
		        	<a href="/list_fav?file_type=fav" class="weui-media-box weui-media-box_appmsg">
			            <div class="weui-media-box__hd">
			                <i class="fileIcon floder"></i>
			            </div>
			            <div class="weui-media-box__bd">
			                <h4 class="weui-media-box__title">我的收藏</h4>
			                {{--<p class="weui-media-box__desc">2017-11-1 09:47:30 565.9M</p>--}}
			            </div>
			        </a>
		        </li>
		        <!-- 一个列表条目 -->
		        <li  class="listItem">
		        	<a href="/list_fav?file_type=at" class="weui-media-box weui-media-box_appmsg">
			            <div class="weui-media-box__hd">
			                <i class="fileIcon floder"></i>
			            </div>
			            <div class="weui-media-box__bd">
			                <h4 class="weui-media-box__title">@我的文件</h4>
			                {{--<p class="weui-media-box__desc">2017-11-1 09:47:30 565.9M</p>--}}
			            </div>
			        </a>
		        </li>
		        
		    </ul>
		</div>
	</div>
	<!--文件列表end-->
	<!--信息提示-->
	<div class="pInfoBar"></div>
	<!--信息提示end-->
@stop

@section('ownJs')
<script>
$(function() {
	//打开链接
    $("[data-url]").click(function() {
        var fn = $(this).data('url');
        location=fn
    });
	$.ajax({
		type:'get',
		url:' /user_file/root',
		dataType:'json',
		success:function(result){console.log(result);
			if(result.code == 0){
				data = result.data;
				$('#root').attr('href', '/list?folder_id='+data.folder_id+'&is_public=0');
				$('#public').attr('href', '/list?folder_id='+data.public_folder_id+'&is_public=1');
				$('#folder_id').val(data.folder_id);
				$('#public_folder_id').val(data.public_folder_id);
//				$('.pInfoBar').text(data.folders_num+'个文件夹，'+data.files_num+'个文件')
			}else if(result.code == -1){
				location.href = '/error';
			}
		}
	});
})
</script>
@stop
